var t, e = function(t) {
    return t && t.__esModule ? t : {
        default: t
    };
}(require("../../../utils/tools.js"));

getApp();

Page({
    data: {
		  showSell: false,
	},
    onLoad: function(e) {
        t = this;
    },
    onReady: function() {
        var a = {
            action: "index",
            contr: "goods",
            token: wx.getStorageSync("token")
        };
        e.default.request(a, function(e) {
            t.setData(e.info);
        });
    },
    onShow: function() {},
	gotoOrder: function() {
	    wx.navigateTo({
	        url: "/bh_farm/pages/order/order"
	    });
	},
	closeDialog:function(){
		this.setData({
		    showSell: false
		});

	},
	showDialog:function(){
	this.setData({
	    showSell: true
	});
	
	},
    goodsDetails: function(t) {
        var e = t.currentTarget.dataset.id;
        wx.navigateTo({
            url: "../goodsDetails/goodsDetails?id=" + e
        });
    },
    gotoGoods: function() {
        wx.navigateTo({
            url: "/bh_farm/pages/goods/goods"
        });
    },
    onShareAppMessage: function() {
        return {
            title: this.data.share.text,
            imageUrl: this.data.share.images,
            path: "bh_farm/pages/index/index?parent_id=" + this.data.share.member_id
        };
    },
    getUserInfo: function(a) {
        if ("getUserInfo:ok" == a.detail.errMsg) {
            var o = {
                action: "register",
                contr: "home",
                token: wx.getStorageSync("token"),
                encryptedData: a.detail.encryptedData,
                iv: a.detail.iv
            };
            e.default.request(o, function(e) {
                t.onReady(), t.showInviteRed();
            });
        }
    }
});